﻿using GetClient_info;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Vision.AlgBase.InspeAlg
{
    [ServiceData(SeriveName = "鼠标触发点击事件", Descri = "啥也不检测")]
    public class TempPointClickAlg : ToolBase
    {
        protected override bool Excute()
        {
            //测试算法
            if (IsFirst(TestAppName))
            {
                //获取窗体的句柄
                WindowIntprt = OperationWindowProcess.GetIntPtrFromStr(TestAppName);
                //置顶窗体
                OperationWindowProcess.WindowMaxAndTop(WindowIntprt);
                Thread.Sleep(200);
                OperationWindowProcess.Mouse_SetMousePos(ControlPoint.X, ControlPoint.Y);
                OperationWindowProcess.Mouse_click(ControlPoint.X, ControlPoint.Y, DesktopSize.Width, DesktopSize.Height);
                OperationWindowProcess.Mouse_wheel(ControlPoint.X, ControlPoint.Y, DesktopSize.Width, DesktopSize.Height, WindowIntprt);
                ErrLog = "";
                return true;
            }
            else
            {
                ErrLog = "测试软件没有开启";
                return false;
            }


                

        }
    }
}
